import java.util.Arrays;
import java.util.Scanner;

public class searchsumson {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] array = new int[5];
        System.out.print("num =");
        for (int i = 0; i < array.length; i++) {
           array[i] = scan.nextInt();
        }
        System.out.print("tmp =");
        int tmp = scan.nextInt();
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
               if(array[i] + array[j+1] == tmp){
                   int[]a = {i,(j+1)};
                   System.out.println(Arrays.toString(a));
                   break;
               }
            }
        }
    }
}
